<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<!DOCTYPE html>
<html>
    <head>
        <base href="<%=basePath%>">
        <meta charset="UTF-8">
        <title>iDanda</title>
    </head>
     <body>
    <div ng-app="" ng-controller="formController">
        登陆模块     
        <form action="">
            <div>姓名:<input name="username" ng-model="current.name"/></div>
            <div>密码:<input name="password" ng-model="current.pass"/></div>
            <p ng-bind="current.name + current.pass"></p>
            <div> 
            <button ng-click="commit()">commit</button>
            </div>
        </form>
    </div>
    <script src="http://apps.bdimg.com/libs/angular.js/1.4.0-beta.4/angular.min.js"></script>
    <script>
        function formController($scope, $http) {
            $scope.commit = function() {
                $http({
                    method:"POST",
                    url:"/user/login",
                    params:{
                        "username":$scope.current.username,
                        "password":$scope.current.password
                    }
                }).success(function(data) {
                    console.log("success...");
                }).error(function() {
                    alert("fail...");
                });
             
            };
        };
    </script> 
</body> 
</html>